package com.zerotwo.exam.center.config;

import com.zerotwo.exam.center.interceptor.ExamCenterInterceptor;
import com.zerotwo.exam.web.config.BaseWebConfig;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

import javax.annotation.Resource;


/**
 * @author 02
 * @version 1.0
 * @Date 2024/7/5
 * @Description web配置类
 */
@Configuration
public class WebConfig extends BaseWebConfig {

    //在此处，将拦截器注册为一个 Bean
    @Resource
    private ExamCenterInterceptor examCenterInterceptor ;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        super.addInterceptors(registry);
        registry.addInterceptor(examCenterInterceptor).addPathPatterns("/exam-center/**");
    }
}
